/*
 * @Author: HuRrongChao 1556810922@qq.com
 * @Date: 2024-07-26 09:59:10
 * @LastEditors: HuRrongChao
 * @LastEditTime: 2025-04-18 17:16:05
 */
module.exports = {
  port: 3000,
  openPermissions: false, // 是否不需要登录就能有权限
  frontendUrl: process.env.NODE_ENV === 'development' 
    ? "http://localhost:3000"  // 开发环境
    : "xxx", // 生产环境
  socketOptions: {
    cors: {
      methods: ["GET", "POST"]
    }
  },
  // 创建连接池，设置连接池的参数
  mysqlOpts: {
    host: 'xxx',
    // 数据库默认的端口号
    port: 3306,
    // 账号
    user: 'root',
    // 密码
    password: "xxx",
    // 数据库的名称
    database: 'video_data',
    waitForConnections: true,
    connectionLimit: 10,
    maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`
    idleTimeout: 60000, // idle connections timeout, in milliseconds, the default value 60000
    queueLimit: 0,
    enableKeepAlive: true,
    keepAliveInitialDelay: 0,
  }
};
